package com.swa.facebookdownloader.dialog;

import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;

import com.swa.facebookdownloader.R;

public class NameDialog extends Dialog {

	public Button btn_continue;
	public Button btn_exit;
	public EditText name_edt;
	public Uri uri;

	public NameDialog(Context context, Uri uri) {
		super(context);
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		this.setContentView(R.layout.dialog_name);
		this.getWindow().setBackgroundDrawable(
				new ColorDrawable(Color.TRANSPARENT));
		this.uri = uri;
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		btn_continue = (Button) findViewById(R.id.name_btn_ok);
		btn_exit = (Button) findViewById(R.id.name_btn_cancel);

		name_edt = (EditText) findViewById(R.id.dialog_edt_filename);

		String filename = (new StringBuilder("video_"))
				.append(System.currentTimeMillis()).append(".mp4").toString();
		name_edt.setHint(filename);

		btn_continue.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				dismiss();
			}
		});

		btn_exit.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				dismiss();
			}
		});

	}

}
